package com.tanhua.server.controller;

import com.tanhua.server.service.TestSoulService;
import com.tanhua.server.vo.QuestionListVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@RequestMapping("testSoul")
@Slf4j
public class TestSoulController {
    @Autowired
    private TestSoulService testSoulService;

    //查询问卷列表
    public ResponseEntity<List<QuestionListVo>> questionnaire(){
        try {
            List<QuestionListVo> list = this.testSoulService.queryQuestionnaireList();
            return ResponseEntity.ok(list);
        } catch (Exception e) {
            log.error("查询问卷列表失败! ",e);
        }
        return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();
    }
}
